package com.example.administrator.teainfo.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.example.administrator.teainfo.R;
import com.example.administrator.teainfo.utils.SharedPreferencesHelper;

public class StartActivity extends AppCompatActivity {
    private SharedPreferencesHelper sph;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        init();
    }

    private void init() {
        sph = new SharedPreferencesHelper(this);
    }

    public void click(View view) {

        String isFirst = sph.getString("isFirst");
//       Log.e("is", "click: "+isFirst);
        Intent intent;
        if ("yes".equals(isFirst)) {
            intent = new Intent(this,FirstRunActivity.class);
//            sph.putString("isFirst","no");
        }else{
            intent = new Intent(this,MainActivity.class);
        }
        startActivity(intent);
        this.finish();
    }
}
